import Home from '@/views/home/Home.vue'
import Login from '@/views/login/Login.vue'
import NotFound from '@/views/notFound/NotFound.vue'
import { createRouter, createWebHistory } from 'vue-router'


const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/home',
      name: 'home',
      component: Home
    },

    {
      path: '/page',
      name: 'page',
      component: import('@/views/home/HomePage.vue'),
      redirect:'/page/store',
      children: [
        {
          path: '/page/store',
          name: 'store',
          component: import('@/views/store/index.vue')
        },
        {
          path: '/page/house',
          name: 'house',
          component: import('@/views/house/index.vue')
        },
        {
          path: '/page/series',
          name: 'series',
          component: import('@/views/store/Series.vue')
        },
        {
          path: '/page/category',
          name: 'category',
          component: import('@/views/store/Category.vue')
        },
        {
          path: '/page/inspiration',
          name: 'inspiration',
          component: import('@/views/store/Inspiration.vue')
        },
        {
          path: '/page/discount',
          name: 'discount',
          component: import('@/views/store/Discount.vue')
        },
        {
          path: '/page/example',
          name: 'example',
          component: import('@/views/store/Example.vue')
        },
        {
          path: '/page/us',
          name: 'us',
          component: import('@/views/us/index.vue')
        },
        {
          path: '/page/search',
          name: 'search',
          component: import('@/views/us/Search.vue')
        },
        {
          path: '/page/mine',
          name: 'mine',
          component: import('@/views/mine/index.vue'),
          redirect:'/page/mine/mine',
          children:[
            {
              path: '/page/mine/mine',
              name: 'mine',
              component: import('@/views/mine/Mine.vue')
            },
            {
              path: '/page/mine/orider',
              name: 'orider',
              component: import('@/views/mine/Orider.vue')
            },
            {
              path: '/page/mine/integral',
              name: 'integral',
              component: import('@/views/mine/Integral.vue')
            },
            {
              path: '/page/mine/collection',
              name: 'collection',
              component: import('@/views/mine/Collection.vue')
            },
            {
              path: '/page/mine/address',
              name: 'address',
              component: import('@/views/mine/Address.vue')
            },
            {
              path: '/page/mine/us',
              name: 'us',
              component: import('@/views/mine/Us.vue')
            },
            {
              path: '/page/mine/history',
              name: 'history',
              component: import('@/views/mine/History.vue')
            },
          ]
        },
        
        {
          path: '/page/car',
          name: 'car',
          component: import('@/views/mine/Car.vue')
        }
      ]
    },
    

    {
      path: '/login',
      name: 'login',
      component: Login
    },
    {
      path: '/',
      redirect: {
        name: 'home'
      }
    },
    {
      path: '/:pathMatch(.*)*',
      component: NotFound,
    }
  ]
})

export default router
